
import com.superenvios.model.EnvioJpaController;
import com.superenvios.model.Envio;
import com.superenvios.model.STATE;
import java.util.List;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Juan
 */
public class prueba {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        Envio e=new Envio();
        e.setDestino("dir1");
        e.setEstado(STATE.RECIBIDO);
        e.setNombreDestinatario("hola");
        e.setOrigen("dir2");
        
        EntityManagerFactory emf= Persistence.createEntityManagerFactory("JavaApplication19PU");
    
        EnvioJpaController etm = new EnvioJpaController(emf);
        
        etm.create(e);
        
        List<Envio> e2 =etm.findEnvioEntities();
        
        if(e2.size() != 1)
            throw new AssertionError();
    }
}
